package com.changgou.consume.dao;

import com.changgou.seckill.pojo.SeckillGoods;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;
import tk.mybatis.mapper.common.Mapper;

/**
 * @Author: HuangFu
 * @Date: 2020/2/24 15:54
 * @Description:
 */
public interface SeckillGoodsMapper extends Mapper<SeckillGoods> {

    /**
     * 更新商品库存
     * @param id
     * @param num
     * @return
     */
    @Update("update tb_seckill_goods set stock_count=stock_count-#{num} where id = #{id}")
    int updateStockCount(@Param("id") Long id,@Param("num") Integer num);

}
